import React, { lazy, Suspense } from 'react'
import LoadingOrError from './components/LoadingOrError'
import './App.css'
// 引入路由组件
import { Switch, Route, BrowserRouter } from 'react-router-dom'


// 引入测试组件
// import Ceshi from "./components/ceshi"
// import Ceshi2 from './components/ceshi2'
// 引入主要页面
const Shouye = lazy(async () => import("./pages/shouye"))
const Login = lazy(async () => import("./pages/login/index"))


function App() {

  return (

    <BrowserRouter>
      <Suspense fallback={<LoadingOrError />}>
        <Switch>
          <Route path="/login" component={Login} />
          <Route path="/" component={Shouye} />
        </Switch>
      </Suspense>
    </BrowserRouter>

  )
}

export default App
